<?php echo $this->fetch('member.header.html'); ?>
<script type="text/javascript">
$(function(){
    $('#add_time_from').datepicker({dateFormat: 'yy-mm-dd',changeMonth: true, changeYear: true});
    $('#add_time_to').datepicker({dateFormat: 'yy-mm-dd',changeMonth: true, changeYear: true});
	$('.checkitem').attr('checked', false);//用于删除时返回复选框全部取消
});
</script>
<style type="text/css">
</style>
<div class="content_color">
<div class="content">
<?php echo $this->fetch('member.menu.html'); ?>
<div id="right">
<?php echo $this->fetch('member.submenu.html'); ?>
<div class="wrap">
  <div class="searchTop">
  <form method="get">
    <input type="hidden" name="app" value="my_kdorder" />
    状态：<select name="status" class="select_class" style="height:28px; padding:3px;">
	<option value="-1">=请选择=</option>
	<option value="0" <?php if ($_GET['status'] == '0'): ?>selected="selected"<?php endif; ?>>未入库</option>
    <option value="1" <?php if ($_GET['status'] == '1'): ?>selected="selected"<?php endif; ?>>部分入库</option>
	<option value="2" <?php if ($_GET['status'] == '2'): ?>selected="selected"<?php endif; ?>>已入库</option>
    <option value="3" <?php if ($_GET['status'] == '3'): ?>selected="selected"<?php endif; ?>>待付款</option>
    <option value="5" <?php if ($_GET['status'] == '5'): ?>selected="selected"<?php endif; ?>>已付款</option> 
    <option value="6" <?php if ($_GET['status'] == '6'): ?>selected="selected"<?php endif; ?>>待发货</option>
    <option value="7" <?php if ($_GET['status'] == '7'): ?>selected="selected"<?php endif; ?>>已发货</option>  
    <option value="8" <?php if ($_GET['status'] == '8'): ?>selected="selected"<?php endif; ?>>已完成</option>
    <option value="9" <?php if ($_GET['status'] == '9'): ?>selected="selected"<?php endif; ?>>已取消</option>  
	</select>&nbsp;&nbsp;
    关键词：<input class="queryInput" type="text" name="key" value="<?php echo htmlspecialchars($_GET['key']); ?>" placeholder="收货人姓名、收货人手机、运单号、转运单号" style="width:280px"/>&nbsp;&nbsp;
    添加时间：<input type="text" value="<?php echo $_GET['add_time_from']; ?>" id="add_time_from" name="add_time_from" class="pick_date" /> 至
    <input type="text" value="<?php echo $_GET['add_time_to']; ?>" id="add_time_to" name="add_time_to" class="pick_date" />
    <input type="submit" class="formbtn" value="查询" />
  </form>
  </div>
  
  <form action="" method="post" id="form_post" target="_blank">
  <div class="public_select table">
  <table width="100%" cellspacing="0">
      <tr class="gray">
        <th width="20" class="firstCell"><input type="checkbox" class="checkall" /></th>
          <th>编号</th>
          <th>快递运单号</th>
          <th>运单状态</th>
          <th>收件人</th>
          <th>收件人手机</th>
          <th>物品数量</th>
          <th>物品价值</th>
          <th>包裹发出仓库</th>
          <th>添加时间</th>
          <th width="60">操作</th>
      </tr>
      <?php $_from = $this->_var['orders']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('', 'order');$this->_foreach['_goods_f'] = array('total' => count($_from), 'iteration' => 0);
if ($this->_foreach['_goods_f']['total'] > 0):
    foreach ($_from AS $this->_var['order']):
        $this->_foreach['_goods_f']['iteration']++;
?>
      <tr class="line">
        <td class="firstCell"><input type="checkbox" class="checkitem" value="<?php echo $this->_var['order']['order_id']; ?>"/></td>
          <td class="left_style"><a href="index.php?app=my_kdorder&act=view&order_id=<?php echo $this->_var['order']['order_id']; ?>" class="links"><?php echo htmlspecialchars($this->_var['order']['order_id']); ?></a></td>
          <td><a href="<?php echo $this->_var['site_url']; ?>/<?php echo url('app=kd_order&ydh=' . $this->_var['order']['yundanhao']. ''); ?>" target="_blank" ><?php echo $this->_var['order']['yundanhao']; ?></a></td>
          <td><?php if ($this->_var['order']['status'] == '0'): ?><font color="#f00">未入库</font>
            <?php elseif ($this->_var['order']['status'] == '1'): ?><font color="#FF9900">部分入库</font>
            <?php elseif ($this->_var['order']['status'] == '2'): ?><font color="#009966">已入库</font>
            <?php elseif ($this->_var['order']['status'] == '3'): ?><font color="#00f">待付款</font>
            <?php elseif ($this->_var['order']['status'] == '5'): ?><font color="#3399CC">已付款</font>
            <?php elseif ($this->_var['order']['status'] == '6'): ?><font color="#FF00FF">待发货</font>
            <?php elseif ($this->_var['order']['status'] == '7'): ?><font color="#336600">已发货</font>
            <?php elseif ($this->_var['order']['status'] == '8'): ?>已完成
            <?php elseif ($this->_var['order']['status'] == '9'): ?><font color="#999">已取消</font>
            <?php endif; ?></td>
          <td><?php echo $this->_var['order']['txtRece_name']; ?></td>
          <td><?php echo $this->_var['order']['txtRece_mobilephone']; ?></td>
          <td><strong style="color:#F00"><?php echo $this->_var['order']['SumGoodsAmount']; ?></strong> 件</td>
          <td><strong style="color:#F00">$<?php echo $this->_var['order']['SumGoodsWorth']; ?></strong></td>
          <td><?php echo $this->_var['order']['CangKuDiZhi']; ?></td>
          <td><?php echo local_date("Y-m-d",$this->_var['order']['addtime']); ?></td>
          <td>
            <?php if ($this->_var['order']['status'] == 3): ?><a href="<?php echo url('app=my_kdorder&act=payment&order_id=' . $this->_var['order']['order_id']. ''); ?>" target="_blank" style="color:#f00">立即付款</a>
            <?php elseif ($this->_var['order']['status'] == 0): ?>
            <a href="index.php?app=my_kdorder&act=edit&order_id=<?php echo $this->_var['order']['order_id']; ?>" class="links">修改</a>&nbsp;&nbsp;
            <a href="javascript:drop_confirm('确定要删除选择的记录吗？删除后不可恢复，请谨慎操作','index.php?app=my_kdorder&act=drop&id=<?php echo $this->_var['order']['order_id']; ?>');" class="links">删除</a>
            <?php else: ?><a href="index.php?app=my_kdorder&act=view&order_id=<?php echo $this->_var['order']['order_id']; ?>" class="links">查看</a>
            <?php endif; ?>
          </td>
    </tr>   
    <?php endforeach; else: ?>
      <tr class="line">
        <td colspan="11" style="padding:8px; color:#F00; text-align:center; font-size:14px;">没有相关记录</td>
          </tr>     
    <?php endif; unset($_from); ?><?php $this->pop_vars();; ?>
  </table>
  </div>
  </form>
  <table width="100%" cellspacing="5">
    <tr>
      <td height="35"><label><input type="checkbox" id="all2" class="checkall"/> 全选</label>
      <a href="javascript:void(0);" uri_target="index.php?app=kuozhan&act=KdOrderPrint" ectype="batchbutton" name="id" class="lcj_btn">打印面单</a>
      </td>
      <td><?php echo $this->fetch('member.page.bottom.html'); ?></td>
    </tr>      
  </table>  
</div></div>
<div class="clear"></div>
</div>
</div>
<?php echo $this->fetch('footer_member.html'); ?>